/*
 * EcomLib.java
 *
 * Created on 2007年7月19日, 下午4:04
 *
 * 花开堪折须直折，莫待无花空折枝！
 *
 */

package com.ecomm.util.taglibs;

import com.ecomm.util.EcomTagLib;
import java.io.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.TagSupport;
import org.apache.struts.taglib.html.BaseInputTag;
/**
 *
 * <p>Title: 易讯聊天系统</p>
 * <p>Description:
 *  易讯聊天系统
 * </p>
 * <p>Copyright: Copyright (c) 2007</p>
 * <p>Company: 联合易讯 </p>
 * @author <font color='blue'>ppliang</font> &nbsp&nbsp<a href="mailto:pijunliang@hotmail.com">pijunliang@hotmail.com</a>
 * @version 1.0
 * @data  2007年7月19日, 下午4:04
 */
public class TextTag  extends TagSupport {
  
  private String name = null;
  
  private String  styleClass= null;
  
  private String  value= null;
  
  private String  maxlength= null;
  
  private String  width= null;
  
  private String  onchange= null;
  
  private String  nonull= null;
  
  private String type = null;
  
  private String permission = "readonly";
  public int doStartTag() throws JspException {
    try {
      HttpServletRequest request=(HttpServletRequest)pageContext.getRequest();
      HttpServletResponse response=(HttpServletResponse)pageContext.getResponse();
      
      EcomTagLib stl = (EcomTagLib)request.getAttribute("ecomTaglib");
      if(stl !=null){
        String text =  stl.text(this.getName(),getMaxlength(),getWidth(),getPermission(),getOnchange(),getNonull(),getStyleClass(),getValue());
        if(text != null){
          pageContext.getOut().print(text);
          return SKIP_PAGE;
        }
      }
    } catch (IOException ioe) {
      throw new JspTagException("ecomlib tag failed");
    }
    return EVAL_BODY_INCLUDE;
  }
  
  public int doEndTag() {
    return EVAL_PAGE;
  }
  
  public String getName() {
    return name;
  }
  
  public void setName(String name) {
    this.name = name;
  }
  
  public String getStyleClass() {
    return styleClass;
  }
  
  public void setStyleClass(String styleClass) {
    this.styleClass = styleClass;
  }
  
  public String getValue() {
    return value;
  }
  
  public void setValue(String value) {
    this.value = value;
  }
  
  public String getMaxlength() {
    return maxlength;
  }
  
  public void setMaxlength(String maxlength) {
    this.maxlength = maxlength;
  }
  
  public String getWidth() {
    return width;
  }
  
  public void setWidth(String width) {
    this.width = width;
  }
  
  public String getOnchange() {
    return onchange;
  }
  
  public void setOnchange(String onchange) {
    this.onchange = onchange;
  }
  
  public String getNonull() {
    return nonull;
  }
  
  public void setNonull(String nonull) {
    this.nonull = nonull;
  }
  
  public String getType() {
    return type;
  }
  
  public void setType(String type) {
    this.type = type;
  }

  public String getPermission() {
    return permission;
  }

  public void setPermission(String permission) {
    this.permission = permission;
  }
}
